<template>
  <div class="container">
    <div class="c-title">新增通知</div>
    <div class="c-content">
      <el-form
        ref="form"
        :label-position="labelPosition"
        label-width="50px"
        :model="formLabelAlign"
      >
        <el-form-item label="标题">
          <el-input v-model="formLabelAlign.title"></el-input>
        </el-form-item>
        <el-form-item label="内容">
          <el-input type="textarea" v-model="formLabelAlign.content"></el-input>
        </el-form-item>
      </el-form>
      <div class="operation">
        <el-button @click.native="handleSend" size="small">发送</el-button>
        <el-button @click="show" size="small">取消</el-button>
      </div>
    </div>
  </div>
</template>

<style lang="less" scoped>
.container {
  width: 900px;
  height: 430px;
  background: rgba(255, 255, 255, 1);
  border-radius: 5px;
  margin-top: 100px;
  margin-left: 200px;
  position: relative;
}
.c-title {
  background-color: #0068b7;
  height: 30px;
  color: white;
  padding: 5px 10px;
}
.operation {
  margin-top: 15px;
  display: flex;
  justify-content: center;
}
.operation .el-button {
  background-color: #267fc2;
  color: white;
}
.el-form {
  width: 50%;
  margin-top: 80px;
  margin-left: 200px;
}
.c-send {
  width: 400px;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0px 11px 16px 4px rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 30px;
  position: relative;
  top: -200px;
  left: 180px;
  z-index: 100;
}
.c-send .row {
  width: 350px;
  padding-left: 10px;
}
.el-checkbox {
  margin-bottom: 13px;
}
</style>

<script>
export default {
  data() {
    return {
      labelPosition: "left",
      formLabelAlign: {
        title: "",
        content: ""
      },
      isShow: false
    };
  },
  methods: {
    show() {
      this.$router.go(-1);
    },
    handleSend() {
      this.$http
        .post("Admin/addAllNotification", {
          title: this.formLabelAlign.title,
          content: this.formLabelAlign.content
        })
        .then(res => {
          this.$message({
            message: "成功",
            type: "success"
          });
        });
    }
  }
};
</script>